package com.chujian.client.gateway;

import com.chujian.client.gateway.fallback.AuthClientFallback;
import com.chujian.framework.auth.Accessor;
import com.chujian.framework.auth.SecurityConst;
import com.chujian.framework.constant.ChujianAppConst;
import com.chujian.framework.core.tsdata.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = ChujianAppConst.SYSTEM_SERVICES_NAME, fallbackFactory = AuthClientFallback.class, contextId = "AuthClient")
public interface AuthClient {

    /**
     * token验证
     *
     * @param uri
     * @param token
     * @return
     */
    @PostMapping("/token/validateJwtToken")
    Result<Accessor> verifyToken(@RequestParam("uri") String uri, @RequestHeader(SecurityConst.TOKEN_HEADER) String token);

}
